import {RouterMount,createRouter} from 'uni-simple-router';

const router = createRouter({
	platform: process.env.VUE_APP_PLATFORM,  
	routes: [...ROUTES]
});
//全局路由前置守卫
router.beforeEach((to, from, next) => {
	//判断当前是否登录的权限
	if(["/pages-demo/router-link/router-link"].includes(to.path)){
		uni.showToast({
			title: '拦截router-link页面',
			icon: 'none',
			success: () => {
				next({path: '/pages/start/login', NAVTYPE: 'push'}); 
			}
		})
	}else{
		next();
	}
});
// 全局路由后置守卫
router.afterEach((to, from) => {
  
})

export {
	router,
	RouterMount
}